Object.classPrototype.removeProperty

Instance of

Function

Parameters

key /*String*/

Return value

this

Description

Removes the property from the object.

Example

let obj;
obj.addProperty("first", 1);
obj.addProperty("second", "a");
obj.removeProperty("second");
if (obj.hasOwnProperty("second"))
    console.write(obj.second);
else
    console.write(obj.first);

Expected output

1